package cn.itsource.wechat.mapper;

import cn.itsource.wechat.domain.WxUser;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.entity.Example;

public interface WxUserMapper extends Mapper<WxUser> {

    /**
     * 通过openid查询wxuser表的对象
     * @param openid
     * @return
     */
    default WxUser findByOpenid(String openid){

        Example example = new Example(WxUser.class);
        example.and().andEqualTo("openid", openid);

        return this.selectOneByExample(example);
    }
}
